package com.jiangxfei.mymvp.di.module;

import com.jiangxfei.mymvp.http.MainRetrofit;
import com.jiangxfei.mymvp.http.OtherRetrofit;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;

@Module
public class RetrofitModule {


    @Singleton
    @Provides
    public MainRetrofit providerMainRetrofit(@Named("default") OkHttpClient okHttpClient) {
        return new MainRetrofit(okHttpClient);
    }

    @Singleton
    @Provides
    public OtherRetrofit privoiderOtherRetrofit(@Named("default") OkHttpClient okHttpClient, String url) {
        return new OtherRetrofit(okHttpClient, url);
    }
}
